p <- ggplot (monsters2, aes (str, int, tooltip = name)) +
geom_point_interactive (aes (size = size, colour = type), alpha = 0.6 ) +
scale_color_manual (values = palette) +
scale_size_identity (guide = "legend" ,
breaks = c (1 , 3 , 4.5 , 7 , 10 ),
labels = c ("Tiny" , "Small or Medium" , "Large" , "Huge" , "Gargantuan" )) +
guides (color = guide_legend (override.aes = list (size = 4 ))) +
facet_wrap_interactive (~ factor (alignment, c ("Lawful Good" , "Lawful Neutral" , "Lawful Evil" ,
"Neutral Good" , "Neutral" , "Neutral Evil" ,
"Chaotic Good" , "Chaotic Neutral" , "Chaotic Evil" )),
nrow = 3 , ncol = 3 , scales = "fixed" ) +
labs (title = title, colour = "Type" , size = "Size" , caption = caption,
x = "Strength" , y = "Intelligence" ) +
theme (plot.background = element_rect (fill = background),
panel.background = element_rect (fill = background),
legend.background = element_rect (fill = background),
text = element_text (family = font2, colour = "#919aa1" , size = 16 ),
plot.title = element_text (size = 50 , family = font, face = "bold" ,
hjust = 0.5 , margin = margin (0 ,0 ,25 ,0 )),
plot.title.position = "plot" ,
plot.caption = element_text (size = 10 , hjust = 0.5 , margin = margin (40 ,0 ,0 ,0 )),
plot.caption.position = "plot" ,
axis.title = element_text (size = 30 , family = font, face = "bold" ),
legend.title = element_text (size = 28 , family = font, face = "bold" ),
panel.grid = element_line (colour = "#454e54" , linetype = "dashed" ),
strip.background = element_rect (fill = "#454e54" ),
strip.text = element_text (face = "bold" ),
plot.margin = margin (30 ,30 ,10 ,30 ))